package com.epfresh.api.widget.gradient.utils;


import com.epfresh.api.widget.gradient.inter.GradientStyle;
import com.epfresh.api.widget.gradient.view.GradientActionBar;
import com.epfresh.api.widget.gradient.view.GradientScrollView;

/**
 * ActionBar背景渐变工具类
 *
 * @author 陈小默
 */
public class GradientUtils {
    private int red = 0xff, green = 0xff, blue = 0xff,
            gradientStyle = GradientStyle.DESC;

    public GradientUtils setColorMode(int gradientStyle, int red, int green,
                                                         int blue) {
        this.gradientStyle = gradientStyle;
        this.red = red;
        this.green = green;
        this.blue = blue;
        return this;
    }

    public void bind(GradientActionBar actionBar, GradientScrollView scrollView) {
        scrollView.bind(actionBar);
        actionBar.bind(scrollView, gradientStyle);
        actionBar.setGradeColor(red, green, blue);
    }
}
